In general, a compiler is a computer software program that transforms high-level computer programming code, such as source code written in a human-readable language (e.g. C, C++), into lower-level assembly or machine code (e.g., binary). Compilers utilize various optimization techniques in order to improve the performance of the resulting executable. In general, optimization allows a program to be executed more rapidly or utilize fewer resources. Link time optimization (LTO) is a powerful compilation technique typically utilized in general computing environments, such desktop computers, that allows the broadening of the optimization scope in programming languages that otherwise compile a program one file at a time. That is, the optimization scope can be broadened so that the compiler can compile and optimize more than one file at a time. LTO utilizes a computer program (i.e., a utility) known as a linker, which links together multiple files of a source program, once optimized by the compiler, to a final executable comprising distinct sections of binary code.
A linker script is another utility used in conjunction with a linker, often in embedded application environments. It is used to express a fine degree of control over the final executable image—and namely, the particular sections thereof—produced during the compilation (and optimization) process. Often, though, if a user tries to use a linker script in an LTO environment, the linker utilized in LTO and the linker script itself come into conflict, which makes the two techniques virtually incompatible. Therefore, a need exists to resolve conflicts between these techniques in order to improve compilation and optimization.